import request from '@/utils/request'

//查询设备列表
export function listDevice(query) {
  return request({
    url: '/erh-iot/device/list',
    method: 'get',
    params: query
  })
}
//查询设备详细
export function getDevice(deviceId) {
  return request({
    url: '/erh-iot/device/' + deviceId,
    method: 'get'
  })
}
//新增设备
export function addDevice(data) {
  return request({
    url: '/erh-iot/device',
    method: 'post',
    data: data
  })
}
//修改设备
export function updateDevice(data) {
  return request({
    url: '/erh-iot/device',
    method: 'put',
    data: data
  })
}
//删除设备
export function delDevice(deviceId) {
  return request({
    url: '/erh-iot/device/' + deviceId,
    method: 'delete'
  })
}
//导出设备列表
export function exportDeviceList() {
  return request({
    url: '/erh-iot/device/export',
    method: 'post'
  })
}

//获取设备模板列表
export function listDeviceMould(query) {
  return request({
    url: '/erh-iot/device_mould/list',
    method: 'get',
    params: query
  })
}
//根据模板id查询模板详细
export function getDeviceMould(devMId) {
  return request({
    url: '/erh-iot/device_mould/' + devMId,
    method: 'get'
  })
}
